import { Actor, Action } from 'iflux2';
import { OrderListType } from '../constant/action-type';

export default class OrderList extends Actor {
    defaultState() {
        return {
            list: [],
            type: 'sales',
            orderMapStatus: {},
            expressCompany: [],
            userLogos: {}
        }
    }


    @Action(OrderListType.SET_LIST)
    setList(state, { list, orderMapStatus }) {
        return state.set('list', list).set('orderMapStatus', orderMapStatus);
    }


    @Action(OrderListType.SET_USER_LOGOS)
    setUserLogos(state, userLogos) {
        return state.set('userLogos', userLogos);
    }


    @Action(OrderListType.SET_EXPRESS_COMPANY)
    setExpressCompany(state, companys) {
        return state.set('expressCompany', companys);
    }


    @Action(OrderListType.SET_TYPE)
    setType(state, type) {
        return state.set('type', type);
    }
}